#ifndef COMMANDPROCESSER_H
#define COMMANDPROCESSER_H

#include <QObject>
#include <QMap>
#include <QSharedPointer>
#include "Command/BaseCmd.h"
#include "DataType/Package.h"
#include "Protocol/BaseProtocol.h"


class CommandProcesser : public QObject
{
    Q_OBJECT
public:
    explicit CommandProcesser(QObject *parent = 0);

    void registerCmd(int functionCode,QMetaObject cmdMetaObject);

    QList<QSharedPointer<BaseCmd> > receiveData(QByteArray data);
    void registerProtocol(BaseProtocol* protocol);

    bool isDecrypt() const;
    void setIsDecrypt(bool isDecrypt);

private:
    QMultiMap<int, QMetaObject> m_cmdMultiMap;
    QList<BaseProtocol*> m_protocolList;
    bool m_isDecrypt;

};

#endif // COMMANDDISPATCHER_H
